package com.zx.tfw.enums;

import java.util.HashMap;
import java.util.Map;

public enum OSEnum {
	
	crossPlatforms		(1, "跨平台"),
	linux				(2, "Linux"),
	mac					(3, "Mac"),
	window				(4, "Window");
	
	private int code;
	
	private String name;

	private OSEnum(int code, String name) {
		this.code = code;
		this.name = name;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	private static Map<Integer, OSEnum> map;
	static {
		map = new HashMap<>();
		OSEnum[] values = OSEnum.values();
		for (OSEnum typeEnum : values) {
			map.put(typeEnum.getCode(), typeEnum);
		}
	}
	
	public static Map<Integer, OSEnum> asMap(){
		return map;
	}
	
	
}
